package com.wang.controller;

import com.wang.pojo.Dept;
import com.wang.service.DeptClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

/**
 * @Author: along
 * @Create: 2021/6/6
 * @Description:
 */
@RestController

public class ConsumerFeignController {
    @Autowired
    private DeptClientService deptClientService = null;

    @RequestMapping("/consumer/dept/get/{id}")
    public Dept getById(@PathVariable("id") Long id) {
       return this.deptClientService.queryById(id);
    }

    @RequestMapping("/consumer/dept/add")
    public boolean add(Dept dept) {
        return this.deptClientService.addDept(new Dept());
    }

    @RequestMapping("/consumer/dept/queryAll")
    public List<Dept> getAll() {
        return this.deptClientService.queryAll();
    }
}
